<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../../../views/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>编辑号源</title>
<head>
    <meta charset="utf-8">
    <title>编辑号源</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">

    <link rel="stylesheet" href="/fdoctor-ms/statics/beginnerAdmin/plugins/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="/fdoctor-ms/statics/beginnerAdmin/plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="/fdoctor-ms/statics/beginnerAdmin/css/btable.css" />
    
    <script type="text/javascript" src="/fdoctor-ms/statics/beginnerAdmin/plugins/layui/layui.js"></script>
    <script type="text/javascript" src="/fdoctor-ms/statics/js/jquery-2.1.4.min.js"></script>
    <script type="text/javascript" src="/fdoctor-ms/statics/js/inputTools.js"></script>
    
</head>

<body>
	<fieldset class="layui-elem-field layui-field-title" style="margin-top: 5px;margin-left: 5px;margin-right: 5px">
	  <legend>编辑号源
	  </legend>
	</fieldset>
	<form class="layui-form" action="" id="dataForm">
	<input type=hidden name="id" id="id" value="${bVo.id}"/>
		<div class="layui-form-item" >
			<div class="layui-inline"  >
				    <label class="layui-form-label" style="width: 100px;">号源时间：</label>
				    <div class="layui-input-inline" " >
				    	<input type="date" name="clinicDate"  class="layui-input"  id="clinicDate"  value="${bVo.clinicDateStr}">
				    </div>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label"  style="width: 100px;"> 号源时间段：</label>
					<div class="layui-input-inline">
						<select name="clinicTime" id="clinicTime" lay-verify="clinicTime" id="clinicTime">
							<option value="0"  <c:if test="${'0' eq bVo.clinicTime}">selected</c:if>>上午</option>
							<option value="1"  <c:if test="${'1' eq bVo.clinicTime}">selected</c:if>>下午</option>
							<!-- <option value="2"  <c:if test="${'2' eq bVo.clinicTime}">selected</c:if>>全天</option>
							<option value="3"  <c:if test="${'3' eq bVo.clinicTime}">selected</c:if>>晚上</option>
							<option value="4"  <c:if test="${'4' eq bVo.clinicTime}">selected</c:if>>休息</option> -->
						</select> 
					</div>
		</div>
		
		<div class="layui-form-item" >
			<label class="layui-form-label" style="width: 100px;"> 剩余预约号源：</label>
			<div class="layui-input-block" >
			      <input type="text" name="remainderNumber"  class="layui-input"  id="remainderNumber"  value="${bVo.remainderNumber}" style="width: 190px;">
			</div>
		</div>
		
		<hr>
	  <div align="center">
	  		<button class="layui-btn layui-btn-big layui-btn-primary layui-btn-radius" type="button" id="saveButton"><i class="layui-icon">&#xe618;</i>确认修改</button>
	  </div>
	</form>
	  
</body>

<script type="text/javascript">
	//初始化表单控件
layui.use(['jquery', 'form','laydate'], function() {
	$ = layui.jquery;
	form = layui.form();
	var laydate = layui.laydate;
	
	
    $('#saveButton').on('click',function(){
    	
    	layer.confirm('确认修改？', {icon: 3, title:'提示'}, function(index){
			layer.close(index);
			$.ajax({
				type : 'POST',
				url : '/fdoctor-ms/outpatientSource/updateSource',
				data : packParams(),
				success : function(data) {
					if (data.code == 200) {
						var index = parent.layer.getFrameIndex(window.name);
						parent.layer.close(index);
						parent.layer.msg('保存成功！', {
							icon : 1
						});
						parent.tableConfig();
					} else {
						parent.layer.msg(data.msg, {
							icon : 2
						});
					}
				}
			});
		});
    });
    
    function packParams(){
    	
    	
    	var param = {
    			id: $('#id').val(),
    			clinicDate: $('#clinicDate').val(), 
    			clinicTime: $('#clinicTime').val(),
    			remainderNumber : $('#remainderNumber').val()
		}
		return param;
	}
   
})

</script>
</html>